{% extends "layout.html.twig" %}

{% set showSearchDesc = 'hide' %}

{% block head_additions %}<meta name="robots" content="noindex, nofollow">{% endblock %}

{% block title %}{{ 'packages.dependent_title'|trans }} - {{ name }} - {{ parent() }}{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-xs-12 package">
            <div class="package-header">
                <h2 class="title">
                    <a href="{{ path("view_package", {name: name}) }}">{{ name }}</a> {{ 'packages.dependents'|trans }}
                    <small>({{ count }})</small>
                    <span class="filters">
                        <span class="filter">
                            Order by:
                            {% if order_by == 'name' %}<span class="active">name</span>{% else %}<a href="{{ path("view_package_dependents", {name: name, order_by: 'name', requires: requires}) }}">name</a>{% endif %} |
                            {% if order_by == 'downloads' %}<span class="active">downloads</span>{% else %}<a href="{{ path("view_package_dependents", {name: name, order_by: 'downloads', requires: requires}) }}">downloads</a>{% endif %}
                        </span>
                        <span class="filter">
                            Show:
                            {% if requires == 'all' %}<span class="active">all</span>{% else %}<a href="{{ path("view_package_dependents", {name: name, order_by: order_by, requires: 'all'}) }}">all</a>{% endif %} |
                            {% if requires == 'require' %}<span class="active">require</span>{% else %}<a href="{{ path("view_package_dependents", {name: name, order_by: order_by, requires: 'require'}) }}">require</a>{% endif %} |
                            {% if requires == 'require-dev' %}<span class="active">require-dev</span>{% else %}<a href="{{ path("view_package_dependents", {name: name, order_by: order_by, requires: 'require-dev'}) }}">require-dev</a>{% endif %}
                        </span>
                    </span>
                </h2>
            </div>
        </div>
    </div>

    <section class="row">
        <section class="col-md-12">
        {% embed "web/list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: false} %}
            {% block content_title %}
            {% endblock %}
        {% endembed %}
        </section>
    </section>
{% endblock %}
